﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContractorAptitude.aspx.cs" Inherits="Catering.Catering_Page.richang.ContractorAptitude" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>承包商-资质审核</title>
    <link rel="stylesheet" type="text/css" href="../../Style/head.css" />
    <link rel="stylesheet" type="text/css" href="../../Style/center.css" />
    <link rel="stylesheet" type="text/css" href="../../Style/zhezhao.css" />
    <script language="javascript" type="text/javascript" src="../../Scripts/My97DatePicker/WdatePicker.js"></script>
    <style type="text/css">
        .rydttitle {
            width: 100%;
        }

            .rydttitle table td {
                text-align: center;
                height: 25;
            }

        .onrydttitle {
            background-image: url('../../images/images_tk_navbg01.jpg');
            width: 105px;
            height: 25px;
            line-height: 25px;
        }

        .outrydttitle {
            background-image: none;
            width: 105px;
            height: 25px;
            line-height: 25px;
        }

        .data_css {
            background-color: #CCCCCC;
        }

            .data_css tr th {
                height: 30px;
                background-image: url('../../images/th_02bg.gif');
            }

            .data_css tr td {
                height: 24px;
                padding: 3px 0px;
                background-color: #ffffff;
                text-align: center;
            }

        .red {
            color: Red;
        }
    </style>
    <script type="text/javascript">
        //显示添加
        function Add() {
            $("#txt_Back").val("");
            $("#txt_classId").val("");
            $("#txt_moonName").val("");
            $("#btnEdit").hide();
            $("#btnAdd").show();
            divshow("main", "bg");
        }

        //显示修改
        function Edit(cid) {
            $("#HidID").val(cid);

            $.ajax({
                type: "Post",
                url: "ContractorAptitude.aspx/Get",
                data: "{'_id':'" + cid + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    $("#txt_id").val(data.d[1] == null ? "" : data.d[1]);
                    $("#txt_moonName").val(data.d[2] == null ? "" : data.d[2]);
                    $("#txt_Back").val(data.d[3] == null ? "" : data.d[3]);

                    $("#btnEdit").show();
                    $("#btnAdd").hide();
                    divshow("main", "bg");
                }
            });
        }

        //添加数据
        function btn_Add() {
            var txt_contractorName = $("#txt_contractorName").val();
            var ddl_operationtype = $("#ddl_operationtype").val();
            var txt_linker = $("#txt_linker").val();
            var txt_linkphone = $("#txt_linkphone").val();
            var txt__address = $("#txt__address").val();
            var txt_state = $("#txt_state").val();
            var txt_evaluate = $("#txt_evaluate").val();

            $.ajax({
                type: "Post",
                url: "ContractorAptitude.aspx/Add",
                data: { _contractorName: txt_contractorName, _evaluate: txt_evaluate, _address: txt__address, _linker: txt_linker, _linkphone: txt_linkphone, _operationtype: ddl_operationtype, _state: txt_state },
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    if (data.d == "OK") {
                        alert("保存成功！");
                        window.location.href = 'ContractorAptitude.aspx';
                    }
                }
            });
        }

        //修改数据
        function btn_Edit() {
            var txt_contractorName = $("#txt_contractorName").val();
            var ddl_operationtype = $("#ddl_operationtype").val();
            var txt_linker = $("#txt_linker").val();
            var txt_linkphone = $("#txt_linkphone").val();
            var txt__address = $("#txt__address").val();
            var txt_state = $("#txt_state").val();
            var txt_evaluate = $("#txt_evaluate").val();
            var cid = $("#HidID").val();

            $.ajax({
                type: "Post",
                url: "ContractorAptitude.aspx/Edit",
                data: "{'_id':'" + cid + "','moonName':'" + txt_moonName + "','classId':'" + txt_classId + "','Back':'" + txt_Back + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    if (data.d == "OK") {
                        alert("保存成功！");
                        window.location.href = 'ContractorAptitude.aspx';
                    }
                }
            });
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div class="xxk_button1">
            <ul>
                <li id="li2_1" class="li_out li_over"><a href="ContractorAptitude.aspx">资质审核</a> </li>
                <li id="li2_2" class="li_out"><a href="ContractorAptitude.aspx">日常维护保养</a> </li>
                <li id="li2_3" class="li_out"><a href="ContractorAptitude.aspx">小型施工监管</a> </li>
                <li id="li2_4" class="li_out"><a href="ContractorAptitude.aspx">终端业务外包管理</a> </li>
            </ul>
        </div>
        <div class="Center_Content" style="min-height: 450px;">
            <div class="div_0207 left_width500" style="height: 30px; width: 998px;">
                <table align="left" style="height: 30px" width="100%" border="0" cellspacing="0" cellpadding="0" class="ckgl_table">
                    <tr>
                        <td width="75" align="right">承包商名称：</td>
                        <td width="110" align="left">
                            <asp:TextBox ID="TextBox1" runat="server" CssClass="input_bg" Style="text-align: center; width: 150px;"></asp:TextBox>
                        </td>
                        <td width="60" align="right">业务类型：</td>
                        <td width="110" align="left">
                            <asp:DropDownList CssClass="select_input_bg" Style="width: 100px;" ID="ddl_type" runat="server" AutoPostBack="True"></asp:DropDownList></td>
                        <td width="60" align="right">
                            <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">查询</asp:LinkButton></td>
                        <td width="110" align="left"></td>
                        <td>&nbsp;</td>
                        <td width="100" align="right">
                            <%--<asp:LinkButton ID="LinkButton2" runat="server" OnClick="LinkButton1_Click">新增</asp:LinkButton>--%>
                            <input type="button" class="input_btn_a" value="新增" onclick="Add()" />
                        </td>
                        <td width="10">&nbsp;</td>
                    </tr>
                </table>
            </div>
            <div style="width: 1000px; margin: 10px auto; clear: both;">
                <table width="100%" border="0" cellpadding="0" cellspacing="1" class="data_css">
                    <thead>
                        <tr>
                            <th width="10%">序号</th>
                            <th width="11%">承包商名称</th>
                            <th width="11%">业务类别</th>
                            <th width="11%">联系人</th>
                            <th width="11%">联系电话</th>
                            <th width="11%">联系地址</th>
                            <th width="11%">状态</th>
                            <th width="11%">评价或说明</th>
                            <th width="11%">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <asp:Repeater ID="Rept_aptitude" runat="server" OnItemCommand="Rept_aptitude_ItemCommand">
                            <ItemTemplate>
                                <tr>
                                    <td><%#Eval("temp1")%></td>
                                    <td><%#Eval("ContractorName")%></td>
                                    <td><%#Eval("OperationType")%></td>
                                    <td><%#Eval("Linker")%></td>
                                    <td><%#Eval("LinkPhone")%></td>
                                    <td><%#Eval("Address")%></td>
                                    <td><%#Eval("State")%></td>
                                    <td><%#Eval("Evaluate")%></td>
                                    <td>
                                        <img alt="" src="../../Images/file.gif" onclick="Edit('<%#Eval("id")%>')" style="cursor: pointer;" />
                                        <asp:ImageButton ID="img_btn" runat="server" ImageUrl="../../Images/trash.gif" OnClientClick="return confirm('确认删除？');"
                                            CommandArgument='<%#Eval("id")%>' CommandName="del" />
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="footer" style="clear: both;">
            <strong>中海油能源发展配餐服务公司渤海自营油田作业公司&nbsp;&nbsp;版权所有@CopyRight 2012</strong><span>技术支持：北京天择嘉业科技有限公司</span>
        </div>
        <!--弹出层-->
        <div id="bg" class="bg">
        </div>
        <div id="main" class="center_div" style="width: 400px; height: 200px; padding: 0px; margin-top: -100px;">
            <div class="div_0207" style="width: 398px; height: 100%; margin: 0px;">
                <h1>
                    <img src="../../Images/cp_h1_03.gif" />承包商-资质审核</h1>
                <table width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td width="65" height="40" align="right">承包商名称：
                        </td>
                        <td width="110">
                            <asp:TextBox ID="txt_contractorName" runat="server" CssClass="input_bg" Width="105"></asp:TextBox>
                        </td>
                        <td width="65" align="right">业务类型：
                        </td>
                        <td width="110">
                            <select class="select_input_bg" style="width: 100px;" id="ddl_operationtype">
                                <option value="日常设备维护">日常设备维护</option>
                                <option value="项目施工监管">项目施工监管</option>
                                <option value="终端外包业务">终端外包业务</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td width="65" height="40" align="right">联系人：
                        </td>
                        <td width="110">
                            <asp:TextBox ID="txt_linker" runat="server" CssClass="input_bg" Width="105"></asp:TextBox>
                        </td>
                        <td width="65" align="right">联系电话：
                        </td>
                        <td width="110">
                            <asp:TextBox ID="txt_linkphone" runat="server" CssClass="input_bg" Width="105"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td width="65" height="40" align="right">联系地址：
                        </td>
                        <td width="110">
                            <asp:TextBox ID="txt__address" runat="server" CssClass="input_bg" Width="105"></asp:TextBox>
                        </td>
                        <td width="65" align="right">状态：
                        </td>
                        <td width="110">
                            <asp:TextBox ID="txt_state" runat="server" CssClass="input_bg" Width="105"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">评价或说明：
                        </td>
                        <td colspan="3">
                            <asp:TextBox ID="txt_evaluate" runat="server" TextMode="MultiLine" CssClass="input_bg"
                                Style="width: 304px; height: 40px;"></asp:TextBox>
                        </td>
                    </tr>
                </table>
                <table width="100%">
                    <tr>
                        <td height="30" align="right">
                            <input type="button" id="btnAdd" onclick="btn_Add()" class="input_btn_a" value="提交" />
                            <input type="button" id="btnEdit" onclick="btn_Edit()" class="input_btn_a" value="提交" />
                        </td>
                        <td>
                            <input type="button" id="but_Close" onclick='divhidel("main", "bg")' class="input_btn_a"
                                value="关闭" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </form>
</body>
</html>

